<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="UTF-8" />
    <title>Modal - Standalone</title>
    <meta
      name="viewport"
      content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
    />
    <link href="../../../../../css/core.css" rel="stylesheet" />
    <link href="../../../../../scripts/testing/styles.css" rel="stylesheet" />
    <script src="../../../../../scripts/testing/scripts.js"></script>
    <script nomodule src="../../../../../dist/ionic/ionic.js"></script>
    <script type="module" src="../../../../../dist/ionic/ionic.esm.js"></script>
  </head>
  <script type="module">
    import { modalController } from '../../../../dist/ionic/index.esm.js';
    window.modalController = modalController;
  </script>
  <body>
    <main>
      <button id="basic-modal" onclick="presentModal()">Present Modal</button>
    </main>

    <script>
      customElements.define(
        'page-one',
        class extends HTMLElement {
          connectedCallback() {
            this.textContent = 'this is a modal';
          }
        }
      );
      async function presentModal() {
        const modalElement = await modalController.create({
          component: 'page-one',
        });
        modalElement.present();
      }
    </script>
  </body>
</html>
